package cn.panda.edu.service.impl;

import cn.panda.edu.dao.CourseInformMapper;
import cn.panda.edu.model.CourseInform;
import cn.panda.edu.service.CourseInformService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CourseInformServiceImpl implements CourseInformService {
	@Resource
	private CourseInformMapper courseInformMapper;

	@Override
	public int deleteByPrimaryKey(Integer informId) {
		// TODO Auto-generated method stub
		return courseInformMapper.deleteByPrimaryKey(informId);
	}

	@Override
	public PageInfo<CourseInform> getAllInform(Integer pageIndex, Integer pageSize) {

		PageHelper.startPage(pageIndex, pageSize);
		List<CourseInform> list = courseInformMapper.getALLInform();
		PageInfo<CourseInform> pageInfo = new PageInfo<>(list);
		return pageInfo;
	}

	@Override
	public int insertSelective(CourseInform courseInform) {
		// TODO Auto-generated method stub
		return courseInformMapper.insertSelective(courseInform);
	}

}
